package com.erdos.hyt.mall.controller;

import com.erdos.hyt.base.model.HytResponse;
import com.erdos.hyt.mall.model.MallBrand;
import com.erdos.hyt.mall.service.MallBrandService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by Administrator on 2017/4/1.
 */
@Api(value = "MallBrandController API")
@RestController
@RequestMapping(value = "/mall")
public class MallBrandController {

    @Autowired
    MallBrandService brandService;

    /**
     * 添加商品品牌信息
     * @param brandName
     * @param brandDesc
     * @param logoUrl
     * @return
     */
    @ApiOperation(value="添加商品品牌", notes="添加商品品牌",httpMethod ="POST", response = HytResponse.class)
    @RequestMapping(value = "/brandAdd", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public HytResponse addBrand(
            @ApiParam(value="品牌名称", required = true)
            @RequestParam(value = "brandName", required = true) String brandName,
            @ApiParam(value="品牌描述", required = true)
            @RequestParam(value = "brandDesc", required = true) String brandDesc,
            @ApiParam(value="品牌logo地址", required = true)
            @RequestParam(value = "logoUrl", required = true) String logoUrl){

        return null;
    }

    /**
     * 根据id删除商品品牌
     * @param brandId
     * @return
     */
    @ApiOperation(value="删除商品品牌", notes="删除商品品牌",httpMethod ="POST", response = HytResponse.class)
    @RequestMapping(value = "/brandDele", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public HytResponse delBrandById(
            @ApiParam(value="品牌id", required = true)
            @RequestParam(value = "brandId", required = true) int brandId){

        return null;
    }

    @ApiOperation(value="更新商品品牌", notes="更新商品品牌",httpMethod ="POST", response = HytResponse.class)
    @RequestMapping(value = "/brandUpd", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public HytResponse updBrand(
            @ApiParam(value="品牌id", required = true)
            @RequestParam(value = "brandId", required = true) int brandId,
            @ApiParam(value="品牌名称", required = true)
            @RequestParam(value = "brandName", required = true) String brandName,
            @ApiParam(value="品牌描述", required = true)
            @RequestParam(value = "brandDesc", required = true) String brandDesc,
            @ApiParam(value="品牌logo地址", required = true)
            @RequestParam(value = "logoUrl", required = true) String logoUrl,
            @ApiParam(value="用户id", required = true)
            @RequestParam(value = "userId", required = true) int userId){

        return null;
    }

    @ApiOperation(value="查询商品品牌", notes="查询商品品牌",httpMethod ="POST", response = HytResponse.class)
    @RequestMapping(value = "/brandList", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public HytResponse<List<MallBrand>> getBrandByCondition(
            @ApiParam(value="品牌对象", required = true)
            @ModelAttribute MallBrand brand){

        return null;
    }
}
